<template>
<div>
  <div>username:{{username}}</div>
  <div>roleId:{{roleId}}</div>
</div>
</template>

<script>
export default {
  name: "Index",
  data(){
    return {
      username:'',
      roleId:''
    }
  },
  methods:{
    getUserInfo(){
      this.$axios.get("/api/user/info")
      .then(data=>{
        if(data.code === 0){
          this.username = data.result.data.username;
          this.roleId = data.result.data.roleId;
        }
      })
    }
  },
  mounted() {
    this.getUserInfo();
    let val = this.$route.query.key;
    console.log(val);
    console.log(this.$route.params.key);
  }
}
</script>

<style scoped>

</style>
